package pers.wensheng.patterns.structural_pattern.adapter_pattern.object_adapter_pattern;

import pers.wensheng.patterns.structural_pattern.adapter_pattern.object_adapter_pattern.entity.Computer;
import pers.wensheng.patterns.structural_pattern.adapter_pattern.object_adapter_pattern.entity.SDCardImpl;
import pers.wensheng.patterns.structural_pattern.adapter_pattern.object_adapter_pattern.entity.TFCardImpl;

/**
 * 用户测试端
 */
public class Client {
    public static void main(String[] args) {
        Computer computer = new Computer();
        System.out.println(computer.readSD(new SDCardImpl()));
        System.out.println("---------------------------------");

        //说用该计算机读取TF卡中的数据
        //定义适配器类
        System.out.println(computer.readSD(new SDAdapterTF(new TFCardImpl())));
    }
}
